<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
     console.log('----------1~100的值-------');
    //打印1~100的值
    let num;
    for(let i=1;i<=100;i++){
        console.log(i);
    }
    console.log('----------1~100的和-------');
    //打印1~100的和
    let sum=0;
    for(let z=1;z<=100;z++){
        sum+=z;//sum=sum+i;
        console.log(sum);
    }
</script>
</html>